<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <link rel="stylesheet" href="../layui/css/layui.css">
    <script src="../layui/layui.js"></script>
</head>
<style type="text/css">
    .layui-form-label {
        width: 90px;
    }
</style>

<body class="layui-layout-body fm-basic">
    <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
        <legend>批量导入用户信息</legend>
    </fieldset>
    <form class="layui-form">
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">导入对象类型</label>
                <div class="layui-input-inline">
                    <select name="quiz">
                        <option value="">请选择问题</option>
                        <optgroup label="城市记忆">
                            <option value="你工作的第一个城市">你工作的第一个城市</option>
                        </optgroup>
                        <optgroup label="学生时代">
                            <option value="你的工号">你的工号</option>
                            <option value="你最喜欢的老师">你最喜欢的老师</option>
                        </optgroup>
                    </select>
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">所属党支部</label>
                <div class="layui-input-inline">
                    <select name="quiz">
                        <option value="">请选择问题</option>
                        <optgroup label="城市记忆">
                            <option value="你工作的第一个城市">你工作的第一个城市</option>
                        </optgroup>
                        <optgroup label="学生时代">
                            <option value="你的工号">你的工号</option>
                            <option value="你最喜欢的老师">你最喜欢的老师</option>
                        </optgroup>
                    </select>
                </div>
            </div>
        </div>
        <div class="layui-upload" style="margin-left:1.5%">
            <button type="button" class="layui-btn layui-btn-normal" id="test8">选择文件</button>
            <button type="button" class="layui-btn" id="test9">开始上传</button>
        </div>
    </form>
    <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
        <legend>批量导出用户信息</legend>
    </fieldset>
    <form class="layui-form" style="margin-top:2%">
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">导出对象类型</label>
                <div class="layui-input-inline">
                    <select name="quiz">
                        <option value="">请选择问题</option>
                        <optgroup label="城市记忆">
                            <option value="你工作的第一个城市">你工作的第一个城市</option>
                        </optgroup>
                        <optgroup label="学生时代">
                            <option value="你的工号">你的工号</option>
                            <option value="你最喜欢的老师">你最喜欢的老师</option>
                        </optgroup>
                    </select>
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">所属党支部</label>
                <div class="layui-input-inline">
                    <select name="quiz">
                        <option value="">请选择问题</option>
                        <optgroup label="城市记忆">
                            <option value="你工作的第一个城市">你工作的第一个城市</option>
                        </optgroup>
                        <optgroup label="学生时代">
                            <option value="你的工号">你的工号</option>
                            <option value="你最喜欢的老师">你最喜欢的老师</option>
                        </optgroup>
                    </select>
                </div>
            </div>
        </div>
        <div class="layui-upload" style="margin-left:1.5%">
            <button type="button" class="layui-btn layui-btn-normal" id="test8">选择文件</button>
            <button type="button" class="layui-btn" id="test9">开始上传</button>
        </div>
    </form>
</body>

<script>
    layui.use(['table', 'layer', 'jquery', 'element', 'laydate', 'form', 'upload'], function () {
        var table = layui.table;
        var layer = layui.layer;
        var $ = layui.jquery;
        var element = layui.element;
        var laydate = layui.laydate;
        var form = layui.form;
        var upload = layui.upload;
        //执行上传
        var uploadInst = upload.render({
            elem: '#upload' //绑定元素
                // ,url: '/ssfwpt/ra/ramanage' //上传接口
                ,
            method: 'POST',
            accept: 'file',
            size: 0,
            before: function (obj) {
                layer.load();
            },
            done: function (res) { //上传完毕回调
                layer.closeAll('loading');
                var result = '';

                for (var i = 0; i < res.length; i++) {
                    result = result + res[i].nsrsbh + "=" + res[i].container + "\n";
                }

                $("#result").html(result);
            },
            error: function () { //请求异常回调
                layer.closeAll('loading');
                layer.msg('网络异常，请稍后重试！');
            }
        });
    });
</script>

</html>